Component({
    data: {
      pickerList: ['苹果', '香蕉', '橙子', '梨子', '葡萄'],  // picker的选项列表
      pickerIndex: 0,  // 当前选中的选项索引
      searchKeyword: '',  // 用户输入的关键字
    },
    methods: {
      pickerChange(e) {
        this.setData({
          pickerIndex: e.detail.value
        });
      },
      searchInputChange(e) {
        this.setData({
          searchKeyword: e.detail.value
        });
      },
      search() {
        const { pickerList, searchKeyword } = this.data;
        const filteredPickerList = pickerList.filter(item => item.includes(searchKeyword));
        this.setData({
          pickerList: filteredPickerList
        });
      }
    }
  });